{% extends 'IMTUserBundle::layout-profile.html.twig' %}

{% block main_title %}Profil - Gérer mes comptes{% endblock %}

{% block include_style %}
{% endblock %}

{% block profil_ariane %}
<li>
	<i class="icon-home"></i><a href="{{ path('fos_user_profile_show') }}">Profil</a>
	<span class="divider">&raquo;</span>
</li>
<li>
	<a href="{{ path('imt_user_contact') }}">Contacts</a>
	<span class="divider">&raquo;</span>
</li>
<li>
	{{ entity.firstname }} {{ entity.name }}
</li>
{% endblock %}

{% block profil_header %}
<div class="profile-head clearfix">
	<div class="profile-info pull-left">
		<h1 class="profile-username">Gérer mes contacts</h1>
	</div>
	
	<div class="btn-toolbar pull-right">
		<div class="btn-group">
			<a class="btn btn-success" href="{{ path('imt_user_contact_new') }}"><i class="icon-plus"></i> Ajouter un contact</a>
	    </div>
	</div>
</div>
{% endblock %}

{% block profil_menu %}
{% include 'IMTUserBundle::menu-profile.html.twig' with {'profile_menu_selected' : 'contacts'} %}
{% endblock %}

{% block profil_content %}
<div class="profile-content">
	<div class="row-fluid">
		<div class="span7 widget">
		    <div class="widget-header light">
				<span class="title">Contact</span>
				<div class="toolbar">
					<div class="btn-group">
						<a class="btn" href="{{ path('imt_user_contact_edit', {'id':entity.id}) }}"><i class="icon-pencil"></i> Editer</a>
						<a href="#" onclick="$(this).children('form').submit(); return false;" class="btn btn-danger"><i class="icon-remove"></i> Supprimer
					        <form action="{{ path('imt_user_contact_delete', { 'id': entity.id }) }}" method="post" class="hide">
					            {{ form_widget(delete_form) }}
					        </form>
				        </a>
					</div>
				</div>
			</div>
			<div class="widget-content user-box">
				<div class="info" style="margin:0;">
					<span class="name">{{ entity.firstname }} {{ entity.name }}</span>
					<ul class="attributes">
						<li><i class="icos-address-book"></i> Comptes associés : {{ entity.accounts|join(', ') }}</li>
						<li><i class="icos-mail"></i> Email : {{ entity.email }}</li>
						<li><i class="icos-calendar-today"></i> Participe : {{ entity.events|length }} événement{% if entity.events|length > 1 %}s{% endif %}</li>
						<li><i class="icos-admin-user-2"></i> {% if entity.user or entity.contactLink %}Utilise MyTime{% else %}N'utilise pas MyTime{% endif %}
					</ul>
				</div>
			</div>
	    </div>
	    
{# 	    <div class="span4">#}
{# 	    	<h4 class="sub"><span>Actions</span></h4>#}
{# 	    	<ul class="nav nav-tabs nav-stacked">#}
{# 				<li><a href="#">Voir mes contacts</a></li>#}
{# 			</ul>	    	#}
{# 	    </div>	    #}
	</div>
</div>
{% endblock %}